#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>


int main()
{   
	int flag = 0;
	char tmp[100] = { 0 };
	
	
	while (scanf("%s", tmp) != '\0')
	{
		int arr[300] = { 0 };
		for (int i = 0; i < strlen(tmp); i++)
		{
			arr[tmp[i]]++;
		}
		int sz = sizeof(arr) / sizeof(arr[0]);
		
		for (int i = 0; i < 300; i++)
		{
			if (arr[i] != 0)
			{
				printf("%c %d\n", i, arr[i]);
			}
		}
		flag++;

	}

	return 0;
}